<!--
  This template loads for the 'tab.friend-detail' state (app.js)
  'friend' is a $scope variable created in the FriendsCtrl controller (controllers.js)
  The FriendsCtrl pulls data from the Friends service (service.js)
  The Friends service returns an array of friend data
  <uses-permission android:name="android.permission.INTERNET" />
-->
<ion-view view-title="{{chat.deviceName}}">
  <ion-nav-bar class="bar-dark">
    <ion-nav-back-button class="button-clear">
      <i class="ion-chevron-left"></i>
    </ion-nav-back-button>
  </ion-nav-bar>
  <ion-content class="padding">
    <div class="list">
      <button class="item button ion-settings button-block button-positive" ng-click="processOrder();" > 处理故障 </button>
      <div class="item item-icon-right" ng-click="getPhoto();">
        拍照
        <i class="icon ion-camera"></i>
      </div>
      <label class="item item-input">
        <textarea rows="5" placeholder="请输入解决方案" ng-model="order.resolution"></textarea>
      </label>
      <!-- Show pictures -->
      <div class="row" ng-repeat="image in images" ng-if="$index % 3 === 0">
        <div class="col col-33" ng-if="$index < images.length">
          <img ng-src="{{images[$index]}}" width="100%" ng-click="onSwipe($index);"/>
        </div>
        <div class="col col-33" ng-if="$index + 1 < images.length">
          <img ng-src="{{images[$index + 1]}}" width="100%" ng-click="onSwipe($index+1);"/>
        </div>
        <div class="col col-33" ng-if="$index + 2 < images.length">
          <img ng-src="{{images[$index + 2]}}" width="100%" ng-click="onSwipe($index+2);"/>
        </div>
      </div>
      <button class="item button ion-settings button-block button-balanced" ng-click="viewOrder();" > 故障详情 </button>
    </div>
    <app-map style="height:40%;" address="{{address}}"> </app-map>

  </ion-content>
</ion-view>
